using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TPI_InterfaceMap : EntityTypeConfiguration<TPI_Interface>
    {
        public TPI_InterfaceMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Type)
                .HasMaxLength(3);

            this.Property(t => t.InputPath)
                .HasMaxLength(100);

            this.Property(t => t.ArchivePath)
                .HasMaxLength(50);

            this.Property(t => t.ErrorPath)
                .HasMaxLength(50);

            this.Property(t => t.BalAcct)
                .HasMaxLength(40);

            this.Property(t => t.LineDelimiter)
                .HasMaxLength(3);

            this.Property(t => t.FieldDelimiter)
                .HasMaxLength(3);

            // Table & Column Mappings
            this.ToTable("TPI_Interface");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.InputPath).HasColumnName("InputPath");
            this.Property(t => t.ArchivePath).HasColumnName("ArchivePath");
            this.Property(t => t.ErrorPath).HasColumnName("ErrorPath");
            this.Property(t => t.Selected).HasColumnName("Selected");
            this.Property(t => t.BalAcct).HasColumnName("BalAcct");
            this.Property(t => t.LineDelimiter).HasColumnName("LineDelimiter");
            this.Property(t => t.AccountMatching).HasColumnName("AccountMatching");
            this.Property(t => t.FieldDelimiter).HasColumnName("FieldDelimiter");
            this.Property(t => t.LineDelimiterLength).HasColumnName("LineDelimiterLength");
            this.Property(t => t.Acct_Pos).HasColumnName("Acct_Pos");
            this.Property(t => t.Amount_Pos).HasColumnName("Amount_Pos");
        }
    }
}
